<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<link rel='stylesheet' href='../../static/news/style/style1.css'>
<link rel='stylesheet' href='../../static/news/style/tab.css'>
<link rel='stylesheet' href='../../static/news/style/extra.css'>
<link rel='stylesheet' href='../../static/news/style/sdmenu.css'>
<script charset="utf-8" src="../../static/news/style/common.js"></script>
<script charset="utf-8" src="../../static/news/style/sdmenu.js"></script>
<script src="/static/public/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="/static/public/page/jquery.pager.js" type="text/javascript"></script>
<script src="/static/public/textSearch.js" type="text/javascript"></script>
<link rel="stylesheet" href="/static/public/page/news_pager.css">
{literal}
<style type="text/css">
.select td{background-color:yellow;}
</style>
<script type='text/javascript'>
// <![CDATA[
var myMenu;
window.onload = function() { myMenu = new SDMenu('my_menu'); myMenu.init(); };
// ]]>

        $(document).ready(function() {  
            $("#pager").pager({ pagenumber:{/literal}{$num.current}, pagecount: {$num.page}{literal}, buttonClickCallback: PageClick });  
           	 $("#chk_all").click(function(){
                 $("input[name='chk_list']").attr("checked",$(this).attr("checked"));
            });
           $("#{/literal}{$current_id}{literal}").addClass("select");
                  });   
      
      
            
        PageClick = function(pageclickednumber) {  
            $("#pager").pager({ pagenumber: pageclickednumber, pagecount: {/literal}{$num.page}{literal}, buttonClickCallback: PageClick });  
           // $("#result").html("Clicked Page " + pageclickednumber);     
            	window.location.href='/news/listing/?type=manage&cid={/literal}{$category.id}{literal}&p='+pageclickednumber;          
        }    

        function act(name){

         var arrChk=$("input[name='chk_list']:checked");
       	 var ids='';
       	 var cid=$("select[name='category']").val(); 

    if(name=='search'){
    	window.location.href='/news/listing/?type=manage&cid='+cid;         
return false;
        }
        
         
         var flag=confirm('确认操作?');
         
         if(flag==false){
             return false;
         }

         $(arrChk).each(function(){
     	     ids=ids+','+this.value;                        
     	  }); 

       	 $.post("/news/copy",{ids:ids,cid:cid,type:name},function(data){
                 alert(data.error);  
                 window.location.href='/news/listing/?type=manage';
     	 },"json");
 	   
 	  
      }       
    </script>
<script type="text/javascript">
function c(){
	 $.post("/news/truncate",function(data){
         alert(data.error);  
	 },"json");
	           }    
	           
function sort(id){
var s=$("#sort"+id).val();

 $.post("/news/s",{sort:s,id:id},function(data){
         alert(data);  
	 });

    
	           }    	           
</script>
{/literal}
</head>

<!-- 头部// -->
{include file="news/top.tpl"}
<!-- 左侧// -->
{include file="news/nav.tpl"}
<!-- 中间// -->
<td valign="top" class="td_content">
<form name="news" action="/news/search" method="post"
	style="margin-bottom: 0px;">

<div class="block titlebox">
<h2 class="title">小编排行榜:<a href="/news/p" target="__blank">统计</a>|<span style="font-weight:normal">标签{foreach from=$flag item=l}
	<a href="/news/search/?key=flag&value={$l.flag}&cid={$category.id}">[{$l.name}]</a>
	{/foreach}</span></h2>
<div class="content" style="height: 20px;"><input type="checkbox"
	name="chk_all" id="chk_all" />全选 {$cate} <input type=button name=copy
	class=imgbutton value="查询" onclick="act('search');"> <input type=button
	name=copy class=imgbutton value="复制" onclick="act('copy');"> <input
	type=button name=move class=imgbutton value="转移" onclick="act('move');">
<!--
<input type=button name=del class=imgbutton value="删除" onclick="act('del');">
--> 类型:<select name="key"><option value="title">标题</option><option value="a.id">ID</option></select><input value="" name="value"> <input type="submit"
	class="imgbutton" value="搜索">
	
	</div>
</div>
</form>



<!-- 内容// -->
<table width="100%" align=center cellspacing=1 cellpadding=5 border=0
	class=mytb>
	<tr class=title>
		<th>序号</th>
		<th>分类</th>
		<th>标题</th>
		<th>发布时间</th>
		<th>小编</th>
		<th>排序</th>
	</tr>

	{section name=l loop=$news }
	<tr id="{$news[l].id}">
		<td  class=left width="8%" style="text-align: left;"><input
			type=checkbox name=chk_list value="{$news[l].id}">{$news[l].id}</td>
		<td class=right width="10%"><a
			href="/news/listing/?type=manage&cid={$news[l].cid}">{$news[l].category_name}</a></td>
		<td class=left width="40%" style="text-align: left;">[<a
			href="/news/edit/?id={$news[l].id}&preid={$category.id}&p={$num.current}"
			style="color: #e75d26" {if $search!=''}target="__blank"{/if}>修改</a>]<a href="/news/v/?id={$news[l].id}" target="__blank">{$news[l].title}</a>
		{foreach from=$news[l].flag item=g} {if $g !=''} [{$g}] {/if}
		{/foreach} {if $news[l].date|time==1}<img
			src="/static/news/images/new.gif" style="vertical-align: middle;"> {elseif $news[l].date|time==2}
			<img
			src="/static/news/images/yesterday.gif" style="vertical-align: middle;">
			 {/if}{if $news[l].thumb !=''}<img
			src="/static/news/images/jpg.gif" style="vertical-align: middle;"
			alt="有缩略图">{/if}</td>
		<td class=right width="10%">{$news[l].date|date_format:"%m-%d %H:%M"}</td>
		<td class=left width="15%" style="text-align: left;">{$news[l].author}</td>
		<td class=right><input type="text" id="sort{$news[l].id}"
			style="width: 40px;" value="{$news[l].sort}" class="sort"> <input
			type="button" value="更新" onclick="sort({$news[l].id})"
			class="imgbutton" /> 
			<!--<a href="/news/remove/?id={$news[l].id}">删除</a>--></td>
	</tr>
	{/section}



</table>



<!-- help -->
<div>
<div id="pager"></div>
共有<font color="red">{$totalnum}</font>条记录</div>
<!-- help --></td>

<!-- 底部// -->
{if $search!=''}
{literal}
<script type="text/javascript">
<!--
$(".mytb").textSearch("{/literal}{$search}{literal}",{markColor: "blue"});
//-->
</script>
{/literal}
{/if}
{include file="news/footer.tpl"}

